<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/22
 * Time: 21:26
 */

namespace app\api\controller\v1;
use app\lib\exception\CategoryException;
use think\Controller;
use app\api\model\Category as CategoryModel;
class Category extends Controller
{
    //获得分类列表
    public function getCategorys()
    {
        $categorys = CategoryModel::all([],'img');
        if(!$categorys) throw new CategoryException();
        return $categorys;
    }
}